{extend name="../../admin/view/main"}

{block name="button"}

{if auth("add")}
<button class='layui-btn layui-btn-sm layui-btn-primary' data-open='{:url("add")}'>添加投资记录</button>
{/if}

{if auth("freed")}
<button class='layui-btn layui-btn-sm layui-btn-primary' data-open='{:url("freed")}'>释放过期债权</button>
{/if}

{/block}

{block name="content"}
<div class="layui-tab layui-tab-card">
    <div class="layui-tab-content">
        {include file='shop/order/index_search'}
        <table class="layui-table margin-top-10" lay-skin="line">
            {notempty name='list'}
            <thead>
            <tr>
                <th class='list-table-check-td think-checkbox'>
                    <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
                </th>
                <th>客户信息</th>
                <th>投资信息</th>
                <th>预计投资利息</th>
                <th>投资利息</th>
                <th>当前状态</th>
                <th>时间</th>
                <th>操作</th>
            </tr>
            </thead>
            {/notempty}
            <tbody>
            {foreach $list as $key=>$vo}
            <tr>
                <td class='list-table-check-td think-checkbox'>
                    <label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label>
                </td>
                <td class="nowrap relative">
                    <div>
                        <div class="inline-block sub-strong-red">
                            <div>客户名称：<span class="color-red">{$vo.name|default='--'}</span></div>
                            <div>身份证：<span class="color-text">{$vo.idcard|default='--'}</span></div>
                            <div>业务员：<span class="color-text">{$vo.staff_name|default='--'}</span></div>
                        </div>
                    </div>
                </td>
                <td class='nowrap'>
                    <div class="inline-block text-middle">
                        <div class="sub-strong-blue">
                            投资产品：<b>{$vo.goods_name}</b>
                        </div>
                        <div class="sub-strong-blue">
                            投资金额：<b>{$vo.money+0|number_format=2}</b> 元
                        </div>
                        <div class="sub-strong-blue">
                            收款方式：
                            {eq name='vo.payment_method' value='0'} <b class="color-blue">划卡</b>{/eq}
                            {eq name='vo.payment_method' value='1'} <b class="color-blue">转账</b>{/eq}
                            {eq name='vo.payment_method' value='2'} <b class="color-blue">现金</b>{/eq}
                            {eq name='vo.payment_method' value='3'} <b class="color-blue">续投</b>{/eq}
                        </div>
                        <div class="sub-strong-blue">
                            年利率：<b>{$vo.goods_annual_rate}</b>%
                        </div>
                        <div class="sub-strong-blue">
                            折标：<b>{$vo.zhebiao}</b>%
                        </div>
                    </div>
                </td>
                <td class="nowrap">
                    <div class="inline-block text-middle">
                        <div class="sub-strong-green">
                            满整月利息金额：<b>{$vo.full_month_lxje}</b> 元
                        </div>
                        <div class="sub-strong-green">
                            起始月利息金额：<b>{$vo.current_month_lxje}</b> 元
                        </div>
                        <div class="sub-strong-green">
                            到期当月利息金额：<b>{$vo.expire_month_lxje}</b> 元
                        </div>
                    </div>
                </td>
                <td class="nowrap">
                    <div class="inline-block text-middle">
                        <div class="sub-strong-red">
                            预计到期总利息：<b>{$vo.expect_lxje}</b> 元
                        </div>
                        <div class="sub-strong-red">
                            预计到期复利：<b>{$vo.expect_lxflje}</b> 元
                        </div>
                        <div class="sub-strong-red">
                            当前已付利息总额：<b>{$vo.current_lxje}</b> 元
                        </div>
                    </div>
                </td>
                <td class="nowrap">
                    {eq name='vo.expire_status' value='0'} <span class="color-green">计息中</span>{/eq}
                    {eq name='vo.expire_status' value='1'} <span class="color-red">已到期</span> {/eq}
                </td>
                <td class="nowrap">
                    <div class="inline-block text-middle">
                        <div>起息日期：<span class="color-blue">{$vo.start_at}</span></div>
                        <div>到期日期：<span class="color-red">{$vo.end_at}</span></div>
                        <div>投资日期：<span class="color-desc">{$vo.invest_date}</span></div>
                        <div>创建时间：<span class="color-text"><b>{$vo.create_at|format_datetime}</b></span></div>
                    </div>
                </td>

                <td class='text-left nowrap'>

                    {if auth("item")}
                    <a class="layui-btn layui-btn-sm layui-bg-cyan" data-open="{:url('item')}?order_id={$vo.id}">复利收益明细</a>
                    {/if}

                    {if auth("edit") and $vo.status eq 1}
                    <a class="layui-btn layui-btn-sm" data-open="{:url('edit')}?id={$vo.id}">编 辑</a>
                    {/if}

                    {if auth("stopRate") and $vo.expire_status eq 0}
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-modal="{:url('stopRate')}?order_id={$vo.id}">提前截止</a>
                    {/if}

                    {if auth("remove")}
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('remove')}" data-confirm="确定要删除此条记录吗吗？" data-value="id#{$vo.id};deleted#1">删 除</a>
                    {/if}

                    {if auth("property")}
                    <a class="layui-btn layui-btn-sm layui-btn-primary" data-modal="{:url('property')}?id={$vo.id}&type=2">解抵</a>
                    {/if}

                    {if auth("property")}
                    <a class="layui-btn layui-btn-sm layui-btn-primary" data-modal="{:url('property')}?id={$vo.id}&type=1">匹配</a>
                    {/if}
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
        {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
    </div>
</div>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //常规用法
        laydate.render({
            elem: '#test2'
        });

    });
</script>
{/block}
